home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr25
/
gnuplsrc.zip
/
PATCHES.OS2
< prev
next >
Wrap
Text File
|
1993-03-21
|
15KB
|
612 lines
*** command.c 1992/07/23 10:26:10 3.26
--- command.c 1992/07/23 11:26:18
***************
*** 84,90 ****
--- 84,94 ----
#ifdef AMIGA_LC_5_1
#define HELPFILE "S:gnuplot.gih"
#else
+ #ifdef OS2
+ #define HELPFILE "gnuplot.gih"
+ #else
#define HELPFILE "docs/gnuplot.gih" /* changed by makefile */
+ #endif /* OS2 */
#endif /* AMIGA_LC_5_1 */
#endif /* HELPFILE */
***************
*** 103,108 ****
--- 107,118 ----
*/
extern struct gnuplot_contours *contour();
+ #ifdef OS2
+ /* emx has getcwd, chdir that can handle drive names */
+ #define getcwd _getcwd2
+ #define chdir _chdir2
+ #endif /* OS2 */
+
#if defined(unix) && !defined(hpux)
#ifdef GETCWD
extern char *getcwd(); /* some Unix's use getcwd */
***************
*** 3314,3332 ****
}
#else /* VFORK */
! #ifdef AMIGA_LC_5_1
do_shell()
{
register char *shell;
if (!(shell = getenv("SHELL")))
shell = SHELL;
-
if (system(shell))
os_error("system() failed",NO_CARET);
(void) putc('\n',stderr);
}
! #else /* AMIGA_LC_5_1 */
#define EXEC "exec "
do_shell()
--- 3324,3348 ----
}
#else /* VFORK */
! #if defined( AMIGA_LC_5_1 ) || defined ( OS2 )
do_shell()
{
register char *shell;
+ #ifdef OS2
+ if (!(shell = getenv("COMSPEC"))) /* shouldn't fail, but .. */
+ shell = "c:\\os2\\cmd.exe"; /* try default ? */
+ if (system(shell)==-1) /* emx returns -1 for error, else */
+ /* code from spawn, so trap it */
+ #else
if (!(shell = getenv("SHELL")))
shell = SHELL;
if (system(shell))
+ #endif /* OS2 */
os_error("system() failed",NO_CARET);
(void) putc('\n',stderr);
}
! #else /* AMIGA_LC_5_1, OS2 */
#define EXEC "exec "
do_shell()
*** graph3d.c 1992/07/19 12:27:44 3.26
--- graph3d.c 1992/07/23 11:26:36
***************
*** 780,785 ****
--- 780,789 ----
{
int len,x1,y1,x2,y2;
register double xr,xnorm,tics,tic,l10;
+ #ifdef OS2
+ /* GCC has problems with x?y:z below, so work around */
+ int temp ;
+ #endif
xr = fabs(tmin-tmax);
***************
*** 804,819 ****
--- 808,839 ----
return -1.0; /* No tics! */
l10 = log10(xr);
+ #ifdef OS2
+ if( l10 >= 0.0 ) temp = (int) l10 ;
+ else temp = (int)l10 - 1 ;
+ #endif
if (logscale) {
+ #ifdef OS2
+ tic = dbl_raise(10.0,temp);
+ #else
tic = dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
+ #endif
if (tic < 1.0)
tic = 1.0;
} else {
+ #ifdef OS2
+ xnorm = pow(10.0,l10-(double)temp);
+ #else
xnorm = pow(10.0,l10-(double)((l10 >= 0.0 ) ? (int)l10 : ((int)l10-1)));
+ #endif
if (xnorm <= 5)
tics = 0.5;
else tics = 1.0;
+ #ifdef OS2
+ tic = tics * dbl_raise(10.0,temp);
+ #else
tic = tics * dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
+ #endif
}
return(tic);
}
*** graphics.c 1992/07/19 11:21:58 3.26
--- graphics.c 1992/07/23 11:45:48
***************
*** 177,198 ****
BOOLEAN logscale;
{
register double xr,xnorm,tics,tic,l10;
!
xr = fabs(tmin-tmax);
l10 = log10(xr);
if (logscale) {
tic = dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
if (tic < 1.0)
tic = 1.0;
} else {
xnorm = pow(10.0,l10-(double)((l10 >= 0.0 ) ? (int)l10 : ((int)l10-1)));
if (xnorm <= 2)
tics = 0.2;
else if (xnorm <= 5)
tics = 0.5;
else tics = 1.0;
tic = tics * dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
}
return(tic);
}
--- 176,216 ----
BOOLEAN logscale;
{
register double xr,xnorm,tics,tic,l10;
! #ifdef OS2
! /* GCC has problems with x?y:z below, so work around */
! int temp ;
! #endif
xr = fabs(tmin-tmax);
l10 = log10(xr);
+ #ifdef OS2
+ if( l10 >= 0.0 ) temp = (int) l10 ;
+ else temp = (int)l10 - 1 ;
+ #endif
if (logscale) {
+ #ifdef OS2
+ tic = dbl_raise(10.0,temp);
+ #else
tic = dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
+ #endif
if (tic < 1.0)
tic = 1.0;
} else {
+ #ifdef OS2
+ xnorm = pow(10.0,l10-(double)temp);
+ #else
xnorm = pow(10.0,l10-(double)((l10 >= 0.0 ) ? (int)l10 : ((int)l10-1)));
+ #endif
if (xnorm <= 2)
tics = 0.2;
else if (xnorm <= 5)
tics = 0.5;
else tics = 1.0;
+ #ifdef OS2
+ tic = tics * dbl_raise(10.0,temp);
+ #else
tic = tics * dbl_raise(10.0,(l10 >= 0.0 ) ? (int)l10 : ((int)l10-1));
+ #endif
}
return(tic);
}
*** help.c 1992/07/19 13:24:27 3.26
--- help.c 1992/07/23 11:26:50
***************
*** 38,43 ****
--- 38,48 ----
* bug-gnuplot@ames.arc.nasa.gov.
*/
+ #ifdef OS2
+ /* GCC defines unix, but no PAGER, so... */
+ #undef unix
+ #endif
+
#include <stdio.h>
extern int errno;
*** parse.c 1992/07/22 10:31:24 3.26
--- parse.c 1992/07/23 11:27:06
***************
*** 70,76 ****
#ifdef __TURBOC__
void fpe()
#else
! #if defined( __ZTC__ ) || defined( _CRAY ) || defined( sgi )
void fpe(an_int)
int an_int;
#else
--- 70,76 ----
#ifdef __TURBOC__
void fpe()
#else
! #if defined( __ZTC__ ) || defined( _CRAY ) || defined( sgi ) || defined (OS2)
void fpe(an_int)
int an_int;
#else
***************
*** 91,97 ****
--- 91,101 ----
#ifdef PC /* thanks to lotto@wjh12.UUCP for telling us about this */
_fpreset();
#endif
+ #ifdef OS2
+ (void) signal(an_int, SIG_ACK);
+ #else
(void) signal(SIGFPE, fpe);
+ #endif
undefined = TRUE;
longjmp(fpe_env, TRUE);
}
*** plot.c 1992/07/19 10:52:50 3.26
--- plot.c 1992/07/23 11:27:12
***************
*** 139,149 ****
#define HOME "sys$login:"
#else /* vms */
! #ifdef MSDOS
#define HOME "GNUPLOT"
! #else /* MSDOS */
#if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
--- 139,149 ----
#define HOME "sys$login:"
#else /* vms */
! #if defined(MSDOS) || defined(OS2)
#define HOME "GNUPLOT"
! #else /* MSDOS, OS2 */
#if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
***************
*** 156,163 ****
--- 156,169 ----
#endif /* MSDOS */
#endif /* vms */
+
#ifdef unix
+ #ifdef OS2
+ /* emx defines unix, but use ms-dos style file */
+ #define PLOTRC "gnuplot.ini"
+ #else
#define PLOTRC ".gnuplot"
+ #endif /* OS2 */
#else /* unix */
#if defined(AMIGA_AC_5) || defined(AMIGA_LC_5_1)
#define PLOTRC ".gnuplot"
***************
*** 173,179 ****
void inter(an_int)
int an_int;
#else
! #ifdef NEXT
void inter(int an_int)
#else
#ifdef sgi
--- 179,185 ----
void inter(an_int)
int an_int;
#else
! #if defined( NEXT ) || defined ( OS2 )
void inter(int an_int)
#else
#ifdef sgi
***************
*** 193,199 ****
--- 199,209 ----
(void) signal(SIGINT, ss_interrupt);
#endif
#else /* MSDOS */
+ #ifdef OS2
+ (void) signal(an_int, SIG_ACK);
+ #else
(void) signal(SIGINT, inter);
+ #endif /* OS2 */
#endif /* MSDOS */
(void) signal(SIGFPE, SIG_DFL); /* turn off FPE trapping */
if (term && term_init)
***************
*** 322,327 ****
--- 332,340 ----
register FILE *plotrc;
static char home[80];
static char rcfile[sizeof(PLOTRC)+80];
+ #ifdef OS2
+ char *temp ;
+ #endif /*OS2*/
/* Look for a gnuplot init file in . or home directory */
#ifdef vms
***************
*** 340,346 ****
--- 353,366 ----
}
}
#else /* AMIGA */
+ #ifdef OS2
+ /*strcpy() can't manage NULL arg */
+ temp = getenv(HOME) ;
+ if( temp == NULL ) temp="/gnuplot" ; /* set a default */
+ (void) strcat(strcpy(home,temp),"/");
+ #else /*OS2*/
(void) strcat(strcpy(home,getenv(HOME)),"/");
+ #endif
#endif /* AMIGA */
#endif /* vms */
#ifdef NOCWDRC
*** plot.h 1992/07/19 10:34:16 3.26
--- plot.h 1992/07/23 11:27:16
***************
*** 107,115 ****
#ifdef unix
#define OS "unix "
#endif
!
#ifdef MSDOS
#define OS "MS-DOS "
--- 107,121 ----
#ifdef unix
+ #ifdef OS2
+ #define OS "OS-2 "
+ #ifdef NOPIPE
+ #undef unix
+ #endif
+ #else
#define OS "unix "
#endif
! #endif
#ifdef MSDOS
#define OS "MS-DOS "
***************
*** 147,156 ****
--- 153,167 ----
#include <math.h>
#define VERYLARGE HUGE
#else
+ #if defined (OS2)
+ /* emx seems to screw up if all digits here */
+ #define VERYLARGE (1.79769313e+308)
+ #else
#define VERYLARGE HUGE
#endif
#endif
#endif
+ #endif
#define END_OF_COMMAND (c_token >= num_tokens || equals(c_token,";"))
***************
*** 172,178 ****
#endif /* vms */
/* If you don't have vfork, then undefine this */
! #if defined(NOVFORK) || defined(MSDOS)
# undef VFORK
#else
# ifdef unix
--- 183,189 ----
#endif /* vms */
/* If you don't have vfork, then undefine this */
! #if defined(NOVFORK) || defined(MSDOS) || defined(OS2)
# undef VFORK
#else
# ifdef unix
***************
*** 190,196 ****
#ifdef vms
# define memcpy(dest,src,len) lib$movc3(&len,src,dest)
#else
! # if defined(MEMCPY) || defined(MSDOS)
/* use memcpy directly */
# else
# ifdef NOCOPY
--- 201,207 ----
#ifdef vms
# define memcpy(dest,src,len) lib$movc3(&len,src,dest)
#else
! # if defined(MEMCPY) || defined(MSDOS) || defined (OS2)
/* use memcpy directly */
# else
# ifdef NOCOPY
***************
*** 206,217 ****
* In case you have MEMSET instead of BZERO. If you have something
* else, define bzero to that something.
*/
! #if defined(MEMSET) || defined(MSDOS)
#define bzero(dest,len) (void)(memset(dest, (char)NULL, len))
#endif /* MEMSET || MSDOS */
/* Give the name of your gamma function, or undefine it if you have none. */
! #if defined(NOGAMMA) || defined(MSDOS)
# undef GAMMA
#else
# ifndef GAMMA
--- 217,228 ----
* In case you have MEMSET instead of BZERO. If you have something
* else, define bzero to that something.
*/
! #if defined(MEMSET) || defined(MSDOS) || defined(OS2)
#define bzero(dest,len) (void)(memset(dest, (char)NULL, len))
#endif /* MEMSET || MSDOS */
/* Give the name of your gamma function, or undefine it if you have none. */
! #if defined(NOGAMMA) || defined(MSDOS) || defined(OS2)
# undef GAMMA
#else
# ifndef GAMMA
*** readline.c 1992/07/21 17:25:16 3.26
--- readline.c 1992/07/23 11:27:38
***************
*** 147,152 ****
--- 147,186 ----
/* get characters */
for(;;) {
cur_char = getc(stdin);
+ #ifdef OS2
+ /* for emx: remap scan codes for cursor keys */
+ if( cur_char == 0 ) {
+ cur_char = getc(stdin);
+ switch( cur_char){
+ case 75: /* left, map to ^B */
+ cur_char=2;
+ break ;
+ case 77: /* right, map to ^F */
+ cur_char=6;
+ break ;
+ case 115: /* ctrl left */
+ case 71: /* home, map to ^A */
+ cur_char=1;
+ break ;
+ case 116: /* ctrl right */
+ case 79: /* end, map to ^E */
+ cur_char=5;
+ break ;
+ case 72: /* up, map to ^P */
+ cur_char=16;
+ break ;
+ case 80: /* down, map to ^N */
+ cur_char=14;
+ break ;
+ case 83: /* delete, map to ^D */
+ cur_char=4;
+ break ;
+ default: /* ignore */
+ cur_char=0;
+ continue ;
+ }
+ }
+ #endif /*OS2*/
if(isprint(cur_char)) {
int i;
for(i=max_pos; i>cur_pos; i--) {
***************
*** 522,527 ****
--- 556,565 ----
rl_termio.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL|NOFLSH);
rl_termio.c_lflag |= (ISIG);
+ #ifdef OS2
+ /* for emx: remove default terminal processing */
+ rl_termio.c_lflag &= ~(IDEFAULT);
+ #endif /* OS2 */
rl_termio.c_cc[VMIN] = 1;
rl_termio.c_cc[VTIME] = 0;
*** scanner.c 1992/07/19 13:24:18 3.26
--- scanner.c 1992/07/24 14:38:08
***************
*** 251,257 ****
}
! #ifdef MSDOS
#ifdef __ZTC__
substitute(char *str,int max)
--- 251,257 ----
}
! #if defined(MSDOS) || defined (NOPIPE)
#ifdef __ZTC__
substitute(char *str,int max)
***************
*** 322,328 ****
--- 322,332 ----
i = 0;
while ((c = getc(f)) != EOF) {
+ #ifdef OS2
+ output[i++] = (((c=='\n')||(c=='\r')) ? ' ' : c); /* newlines become blanks*/
+ #else
output[i++] = ((c == '\n') ? ' ' : c); /* newlines become blanks*/
+ #endif
if (i == max) {
#ifdef AMIGA_AC_5
(void) close(fd);
*** term.c 1992/07/19 10:15:18 3.26
--- term.c 1992/07/23 11:27:32
***************
*** 255,260 ****
--- 255,264 ----
#include "term/pc.trm"
#endif
+ #ifdef OS2PM /* os/2 presentation manager */
+ #include "term/pm.trm"
+ #endif
+
/*
all TEK types (TEK,BITGRAPH,KERMIT,VTTEK,SELANAR) are ifdef'd in tek.trm,
but most require various TEK routines. Hence TEK must be defined for
***************
*** 952,957 ****
--- 956,970 ----
PPMgraphics, PBMmove, PBMvector, PPMlinetype,
PBMput_text, PBMtext_angle, null_justify_text, do_point,
do_arrow}
+ #endif
+
+ #ifdef OS2PM
+ ,{"pm", "OS/2 Presentation Manager",
+ PM_XMAX, PM_YMAX, PM_VCHAR, PM_HCHAR,
+ PM_VTIC, PM_HTIC, options_null, PM_init, PM_reset,
+ PM_text, null_scale, PM_graphics, PM_move, PM_vector,
+ PM_linetype, PM_put_text, PM_text_angle,
+ PM_justify_text, line_and_point, do_arrow}
#endif
#ifdef POSTSCRIPT
*** term.h 1992/07/19 10:15:29 3.26
--- term.h 1992/07/23 11:27:22
***************
*** 49,55 ****
*/
/* These terminals are not relevant for MSDOS */
! #ifndef MSDOS
#ifdef AMIGA_LC_5_1
#define AMIGASCREEN /* Amiga custom screen */
--- 49,55 ----
*/
/* These terminals are not relevant for MSDOS */
! #if !defined(MSDOS) && !defined(OS2)
#ifdef AMIGA_LC_5_1
#define AMIGASCREEN /* Amiga custom screen */
***************
*** 131,134 ****
--- 131,138 ----
#define HERCULES /* IBM PC/Clone with Hercules graphics board */
#endif /* __TURBOC__ */
#endif /* MSDOS */
+
+ #ifdef OS2
+ #define OS2PM
+ #endif